{% extends 'core/base.html' %}

{% block title %}Teams | {{ block.super }}{% endblock %}

{% block page-header-title %}
<h1>List of teams</h1>
{% endblock %}

{% block page-header-right %}
<div class="m-b-1">
{% include 'accounts/user-widget.html' with logout_redirect=request.path %}
</div>
<a href="{% url 'dtracker-teams-create' %}" class="btn btn-primary">Create a new team</a>
{% endblock %}

{% block content %}
<ul class="list-group m-t-1">
{% for team in team_list %}
<li class="list-group-item">
    <span><a href="{{ team.get_absolute_url }}">{{ team }}</a></span>
    <span>(</span><span title="Number of packages">{{ team.packages.all|length }}</span><span>, </span>
    <span title="Number of members">{{ team.members.all|length }}</span><span>)</span>
</li>
{% endfor %}
</ul>
{% if is_paginated %}
<div class="text-xs-center">
<ul class="pagination">
    {% for page in page_obj.paginator.page_range %}
    <li class="page-item{% if page_obj.number == page %} active{% endif %}"><a class="page-link" href="?page={{ page }}">{{ page }}</a></li>
    {% endfor %}
</ul>
</div>
{% endif %}
{% endblock %}
